home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / CIncludes / Dialogs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-29  |  5.3 KB  |  202 lines  |  [TEXT/MPS ]

  1.  
  2. /************************************************************
  3.  
  4. Created: Thursday, September 12, 1991 at 2:46 PM
  5.  Dialogs.h
  6.  C Interface to the Macintosh Libraries
  7.  
  8.  
  9.   Copyright Apple Computer, Inc.  1985-1991
  10.   All rights reserved
  11.  
  12. ************************************************************/
  13.  
  14.  
  15. #ifndef __DIALOGS__
  16. #define __DIALOGS__
  17.  
  18. #ifndef __WINDOWS__
  19. #include <Windows.h>
  20. #endif
  21.  
  22. #ifndef __TEXTEDIT__
  23. #include <TextEdit.h>
  24. #endif
  25.  
  26.  
  27. enum {
  28.  
  29.  ctrlItem = 4,
  30.  btnCtrl = 0,
  31.  chkCtrl = 1,
  32.  radCtrl = 2,
  33.  resCtrl = 3,
  34.  statText = 8,
  35.  editText = 16,
  36.  iconItem = 32,
  37.  picItem = 64,
  38.  userItem = 0,
  39.  itemDisable = 128,
  40.  ok = 1,
  41.  cancel = 2,
  42.  stopIcon = 0,
  43.  noteIcon = 1,
  44.  cautionIcon = 2
  45. };
  46.  
  47. /* Dialog Item List Manipulation Constants */
  48. typedef short DITLMethod;
  49.  
  50. enum {
  51.  
  52.  overlayDITL = 0,
  53.  appendDITLRight = 1,
  54.  appendDITLBottom = 2
  55. };
  56.  
  57. typedef short StageList;
  58.  
  59.  
  60. typedef WindowPtr DialogPtr;
  61. typedef pascal void (*ResumeProcPtr)(void);
  62. typedef pascal void (*SoundProcPtr)(void);
  63. typedef pascal Boolean (*ModalFilterProcPtr)(DialogPtr theDialog, EventRecord *theEvent, short *itemHit);
  64.  
  65. struct DialogRecord {
  66.  WindowRecord window;
  67.  Handle items;
  68.  TEHandle textH;
  69.  short editField;
  70.  short editOpen;
  71.  short aDefItem;
  72. };
  73.  
  74. typedef struct DialogRecord DialogRecord;
  75. typedef DialogRecord *DialogPeek;
  76.  
  77. struct DialogTemplate {
  78.  Rect boundsRect;
  79.  short procID;
  80.  Boolean visible;
  81.  Boolean filler1;
  82.  Boolean goAwayFlag;
  83.  Boolean filler2;
  84.  long refCon;
  85.  short itemsID;
  86.  Str255 title;
  87. };
  88.  
  89. typedef struct DialogTemplate DialogTemplate;
  90. typedef DialogTemplate *DialogTPtr, **DialogTHndl;
  91.  
  92. struct AlertTemplate {
  93.  Rect boundsRect;
  94.  short itemsID;
  95.  StageList stages;
  96. };
  97.  
  98. typedef struct AlertTemplate AlertTemplate;
  99. typedef AlertTemplate *AlertTPtr, **AlertTHndl;
  100.  
  101.  
  102. #ifdef __cplusplus
  103. extern "C" {
  104. #endif
  105. pascal void InitDialogs(ResumeProcPtr resumeProc)
  106.  = 0xA97B; 
  107. pascal void ErrorSound(SoundProcPtr soundProc)
  108.  = 0xA98C; 
  109. pascal DialogPtr NewDialog(void *wStorage,const Rect *boundsRect,ConstStr255Param title,
  110.  Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  111.  Handle itmLstHndl)
  112.  = 0xA97D; 
  113. DialogPtr newdialog(void *wStorage,const Rect *boundsRect,char *title,Boolean visible,
  114.  short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,Handle itmLstHndl); 
  115. pascal DialogPtr GetNewDialog(short dialogID,void *dStorage,WindowPtr behind)
  116.  = 0xA97C; 
  117. pascal void CloseDialog(DialogPtr theDialog)
  118.  = 0xA982; 
  119. pascal void DisposDialog(DialogPtr theDialog)
  120.  = 0xA983; 
  121. pascal void DisposeDialog(DialogPtr theDialog)
  122.  = 0xA983; 
  123. pascal void CouldDialog(short dialogID)
  124.  = 0xA979; 
  125. pascal void FreeDialog(short dialogID)
  126.  = 0xA97A; 
  127. pascal void ParamText(ConstStr255Param param0,ConstStr255Param param1,ConstStr255Param param2,
  128.  ConstStr255Param param3)
  129.  = 0xA98B; 
  130. pascal void ModalDialog(ModalFilterProcPtr filterProc,short *itemHit)
  131.  = 0xA991; 
  132. pascal Boolean IsDialogEvent(const EventRecord *theEvent)
  133.  = 0xA97F; 
  134. pascal Boolean DialogSelect(const EventRecord *theEvent,DialogPtr *theDialog,
  135.  short *itemHit)
  136.  = 0xA980; 
  137. pascal void DrawDialog(DialogPtr theDialog)
  138.  = 0xA981; 
  139. pascal void UpdtDialog(DialogPtr theDialog,RgnHandle updateRgn)
  140.  = 0xA978; 
  141. pascal void UpdateDialog(DialogPtr theDialog,RgnHandle updateRgn)
  142.  = 0xA978; 
  143. pascal short Alert(short alertID,ModalFilterProcPtr filterProc)
  144.  = 0xA985; 
  145. pascal short StopAlert(short alertID,ModalFilterProcPtr filterProc)
  146.  = 0xA986; 
  147. pascal short NoteAlert(short alertID,ModalFilterProcPtr filterProc)
  148.  = 0xA987; 
  149. pascal short CautionAlert(short alertID,ModalFilterProcPtr filterProc)
  150.  = 0xA988; 
  151. pascal void CouldAlert(short alertID)
  152.  = 0xA989; 
  153. pascal void FreeAlert(short alertID)
  154.  = 0xA98A; 
  155. pascal void GetDItem(DialogPtr theDialog,short itemNo,short *itemType,Handle *item,
  156.  Rect *box)
  157.  = 0xA98D; 
  158. pascal void SetDItem(DialogPtr theDialog,short itemNo,short itemType,Handle item,
  159.  const Rect *box)
  160.  = 0xA98E; 
  161. pascal void HideDItem(DialogPtr theDialog,short itemNo)
  162.  = 0xA827; 
  163. pascal void ShowDItem(DialogPtr theDialog,short itemNo)
  164.  = 0xA828; 
  165. pascal void SelIText(DialogPtr theDialog,short itemNo,short strtSel,short endSel)
  166.  = 0xA97E; 
  167. pascal void GetIText(Handle item,Str255 text)
  168.  = 0xA990; 
  169. pascal void SetIText(Handle item,ConstStr255Param text)
  170.  = 0xA98F; 
  171. pascal short FindDItem(DialogPtr theDialog,Point thePt)
  172.  = 0xA984; 
  173. pascal DialogPtr NewCDialog(void *dStorage,const Rect *boundsRect,ConstStr255Param title,
  174.  Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  175.  Handle items)
  176.  = 0xAA4B; 
  177. DialogPtr newcdialog(void *dStorage,const Rect *boundsRect,char *title,
  178.  Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  179.  Handle items); 
  180. #define GetAlrtStage() (* (short*) 0x0A9A)
  181. pascal void ResetAlrtStage(void)
  182.  = {0x4278,0x0A9A}; 
  183. pascal void DlgCut(DialogPtr theDialog); 
  184. pascal void DlgPaste(DialogPtr theDialog); 
  185. pascal void DlgCopy(DialogPtr theDialog); 
  186. pascal void DlgDelete(DialogPtr theDialog); 
  187. pascal void SetDAFont(short fontNum)
  188.  = {0x31DF,0x0AFA}; 
  189. void paramtext(char *param0,char *param1,char *param2,char *param3); 
  190. void getitext(Handle item,char *text); 
  191. void setitext(Handle item,char *text); 
  192. short findditem(DialogPtr theDialog,Point *thePt); 
  193.  
  194. pascal void AppendDITL(DialogPtr theDialog,Handle theHandle,DITLMethod method); 
  195. pascal short CountDITL(DialogPtr theDialog); 
  196. pascal void ShortenDITL(DialogPtr theDialog,short numberItems); 
  197. #ifdef __cplusplus
  198. }
  199. #endif
  200.  
  201. #endif
  202.